-- @owner: opentestcase001
-- @date: 2022/4/6
-- @testpoint: 创建ustore表,结合delete+where条件执行explain plan
-- @modified: by opentestcase007 2023/9/5 增加清理序列步骤

--step1:建表，插入数据   expect:成功
drop table if exists t_s_condition_0021;
create table t_s_condition_0021(col_1 integer,col_2 bigint constraint t_s_condition_0021_pk primary key,col_3 float8,col_4 decimal(12,6),col_5 bool,col_6 char(30),col_7 varchar2(50),col_8 varchar(30),col_9 interval day to second,col_10 timestamp,col_11 date,col_12 smalldatetime,col_13 timestamp without time zone,col_14 blob,col_15 clob,col_16 int[]) with (storage_type=ustore);

drop sequence if exists seq_s_condition_0021;
create sequence seq_s_condition_0021 increment by 1 start with 10;

insert into t_s_condition_0021 (col_1,col_2) values (1,seq_s_condition_0021.nextval);


--step2:结合delete+where条件执行explain plan   expect:成功
explain plan for delete from t_s_condition_0021 where col_2 = 30;

--step3:查看系统表plan_table中关键字段信息   expect:成功
select operation,options,object_name,object_type,projection from plan_table order by operation,projection;

--step4:环境清理  expect:成功
delete from plan_table;
drop table t_s_condition_0021 cascade;
drop sequence if exists seq_s_condition_0021;